﻿using System;
using System.Linq;
using System.Windows;
using System.Collections.Generic;
using System.Text;
using System.Net.Http;
using MetroDropBox.Shared;
using System.Threading.Tasks;
using System.Net;
using Windows.Security.Authentication.Web;
using System.Diagnostics;

namespace MetroTwitter.External.Twitter
{
    public class TwitterClient : oAuthClientBase
    {
        public TwitterClient(string apiKey, string apiSecret) : base(apiKey, apiSecret) { }

        protected override void init()
        {
            useSha1Signing = true;
            usesAuthHeader = true;
            getRequestTokenParamsInPostContent = true;
            upperCaseUrlEncoding = true;
            usesOAuthVerifier = true;
            getRequestTokenURL = "https://api.twitter.com/oauth/request_token";
            getRequestTokenMethod = "POST";
            getUserLoginURL = "https://api.twitter.com/oauth/authorize";
            getAuthTokenURL = "https://api.twitter.com/oauth/access_token";

        }

        public async Task<String> GetAccountTotals()
        {
            var url = "https://api.twitter.com/1/account/totals.json";
            return await httpGetForString(url, new Dictionary<string,string>());
        }
    }
}
